package vip.xiaonuo.tasks;

import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import vip.xiaonuo.core.timer.TimerTaskRunner;
import vip.xiaonuo.facedoor.modular.visitor.service.FacedoorVisitorService;

@Component
public class CleanVisitorTask implements TimerTaskRunner {

  @Autowired
  private FacedoorVisitorService visitorService;
  @Override
  public void action(String taskId,String taskParam) {
    execute();
  }

  private void execute() {
    visitorService.cleanVisitor();
  }

  @Override
  @XxlJob("CleanVisitorTask")
  public void executeXxlJob() {
    this.execute();
  }
}
